//
//  NSString+XMXCateGory.h
//  XMXTool
//
//  Created by Xiemaoxiong on 16/3/18.
//  Copyright © 2016年 杭州犇富互联网金融服务有限公司. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

// 样式
@interface AttributeStyle : NSObject
@property (nonatomic ,strong) NSString * AttributeName;
@property (nonatomic ,strong) id  value;
@property (nonatomic)  NSRange  range;

+(AttributeStyle *)AttributeName:(NSString *)attributeName value:(id)value range:(NSRange)range;
@end


@interface ForeStyle : AttributeStyle
// 设置颜色
+(ForeStyle *)withColor:(UIColor *)color range:(NSRange)range;
// 设置字体大小
+(ForeStyle *)withFont:(UIFont *)font range:(NSRange)range;
// 设置删除线
+(ForeStyle *)withDeletelineStylerange:(NSRange)range;
// 设置删除线颜色
+(ForeStyle *)withDeletelineStyleColor:(UIColor *)color range:(NSRange)range;

@end

@interface NSString (XMXCateGory)
/// 将字符串转换成数组
- (NSArray*)XMX_Array;

/// 获取由当前的NSString转换来的UIColor
- (UIColor*)XMX_color;

/// 判断是否为正确的手机号格式
- (BOOL)XMX_isPhoneNumber;

/// 判断是否为正确的密码长度
- (BOOL)XMX_isVaildPassword;

/// 是否为有效身份证号码
-(BOOL)XMX_isIdCard;

/// 是否为数字
- (BOOL)XMX_isNumber;

/// 是否为汉字
- (BOOL)XMX_isChineseCharacter;
// 根据数组创建出富文本 返回富文本
-(NSAttributedString *)XMX_createAttributeStringWithStyles:(NSArray *)styles;

/// 中文转码
- (NSString *)encodeToPercentEscapeString;

/// 行高 默认:15
-(NSAttributedString *)XMX_lineHeight:(CGFloat)lineheight;
@end
